<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>AngularJS集合遍历显示</title>
		<script type="text/javascript" src="../js/angular.min.js"></script>
	</head>

	<body ng-app="myapp" ng-controller="myctrl">
		<table width="100%" border="1">
			<tr>
				<th>序号</th>
				<th>商品编号</th>
				<th>商品名称</th>
				<th>商品价格</th>
			</tr>
			<tr ng-repeat="p in products">
				<td>{{$index+1}}</td>
				<td>{{p.id}}</td>
				<td>{{p.name}}</td>
				<td>{{p.price}}</td>
			</tr>
		</table>

	</body>
	<script type="text/javascript">
		var myapp = angular.module("myapp", []);
		myapp.controller("myctrl", ["$scope", function($scope) {
			$scope.products = [{
					id: 001,
					name: '数码相机',
					price:3000
				},
				{
					id: 002,
					name:'电视机',
					price:5000
				}
			];
		}])
	</script>
	

</html>